{% extends "base.html" %}
{% from "macro.html" import gallery_bread with context %}
{% block head %}
    {{ super() }}
{% endblock %}
{% block title %}
    青年相册
{% endblock %}
{% block content %}
    <style>

        .border-card{
            border: 5px solid rgba(0 123 255 / 5%);
            margin: 0px 0px 5px 0px;
        }
        .photo-link{
            text-decoration: none;
            color: #0f0f0f;
        }
        a:hover{
            color: #9d9d9d;
        }
    </style>
    <main>
        <div class="container">
            {% include "_flash.html" %}
            <div>
                {{ gallery_bread('相片类别-'+tags.name, tags.name) }}
                {% for photo in photos %}
                    <div class="border-card card photo-card">
                        <a href="/gallery/photo/{{ photo.id }}" class="card-thumbnail">
                            <img class="card-img-top portrait" src="{{ photo.save_path_s }}" alt="{{ photo.title }}">
                        </a>
                        <div class="card-body">
                            <a class="photo-link" href="/gallery/photo/{{ photo.id }}"> {{ photo.title }} </a>
                            <div class="row">
                                <div class="col-lg-4">
                                    <i class="fa fa-comment"></i> {{ photo.comments|length }}
                                    <i class="fa fa-heart"></i> {{ photo.likes|length }}
                                </div>
                                <div class="col-lg-8 text-right">
                                    <i class="fa fa-calendar"></i> {{ (photo.create_time|split)[0] }}
                                </div>
                            </div>
                        </div>
                    </div>
                {% endfor %}
            </div>
        </div>
    </main>
{% endblock %}